The present invention relates to a circuit for detecting a motion vector corresponding to the size and the direction of movement of an image.
Various types of animation encoding standards adopt motion-compensated predictive coding. In the motion compensated predictive coding, a motion vector in an image to be encoded is detected and motion compensation is effected on the basis of the detected motion vector before intra-frame prediction. The result of the intra-frame prediction (i.e., a difference between a succeeding frame and a preceding frame) is subjected to discrete cosine transform (DCT). The detection of the motion vector and the motion compensation is carried out with a block comprising 16.times.16 pixels (i.e., a macro block) used as a unit, and the DCT is carried out with a sub block comprising 8.times.8 pixels used as a unit.
Conventionally, a motion vector is detected in an input image and a reference image by a technique designated as block matching. In the block matching, a block to be processed (comprising 16.times.16 pixels) is first extracted from an input image, and a plurality of prospective reference blocks (each comprising 16.times.16 pixels) are extracted from a certain search range in a reference image. Then, with regard to each of the plural prospective reference blocks, an evaluation value indicating similarity with the block to be processed is calculated. This evaluation value is calculated as a sum of squares of differences in the pixel values between these blocks or as a sum of absolute values of the differences in the pixel values between these blocks. One prospective reference block, among the plural prospective reference blocks, having the minimum evaluation value, namely, one which is most similar to the block to be processed, is selected as a reference block. Ultimately, a motion vector corresponding to the positional relationship between the block to be processed and the reference block is determined.
However, when brightness variation such as a flicker and fade-in/fade-out is caused in the input image, namely, when a DC component is varied in the input image, a precise motion vector cannot be detected. Therefore, Japanese Laid-Open Patent Publication No. 5-292489 discloses a method of estimating a motion vector as a countermeasure against this problem. In this method, an average value of all the pixels in an input image is subtracted from each of the pixel values in a block to be processed (comprising 16.times.16 pixels), and an average value of all the pixels in a reference image is subtracted from each of the pixel values in a prospective reference block (comprising 16.times.16 pixels), and thereafter, an evaluation value for the block matching is calculated. Alternatively, Japanese Laid-Open Patent Publication No. 6-178284 discloses a motion vector detecting circuit. In this circuit, an average value of pixels in a block to be processed (comprising 16.times.16 pixels) is subtracted from each of the pixel values in the block to be processed, and an average value of pixels in a prospective reference block (comprising 16.times.16 pixels) is subtracted from each of the pixel values in the prospective reference block, and thereafter, an evaluation value for the block matching is calculated.
In the aforementioned conventional techniques, however, an AC component included in a DCT result obtained from an image difference cannot be minimized. Therefore, encoding efficiency cannot be improved.